<%@page import="java.util.List"%>

<%@page import="shop3.domain.Product"%>
<%@page import="shop3.dao.UserDAOimp"%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>买了呀</title>
    <!--设置标签图标-->
    <link href="favicon.ico" rel="shortcut icon">
    <style>
    	p{
    		overflow: hidden;
        	text-overflow: ellipsis;
        	display: -webkit-box;
        	-webkit-line-clamp:2;
        	-webkit-box-orient: vertical;
    	}
    	.page{
		width:400px;
		text-align:center;
		margin:auto;
	}
	li img{
		width:200px;
		height:200px;
	}
	li {
		display:inline-block;
	}
	.yuan{
    color: #ff4400;
    font-size: 10px;
	}
	.price{
	    color: #ff4400;
	    font-weight: bold;
	    margin-left: 3px;
	}
	
	#hot_goods{
	    width: 1200px;
	    margin: 10px auto;
	}
	#hot_goods h3{
	    height: 44px;
	    line-height: 44px;
	    font-size: 20px ;
	    color: #ff242d;
	    padding-left: 10px;
	    border-bottom: 1px solid #ccc;
	    background: white;
	
	}
	#hot_goods .hot_goods_body ul{
	    list-style: none;
	    overflow: hidden;
	}
	#hot_goods .hot_goods_body ul li{
	    width: 236px;
	    height: 315px;
	    background: white;
	    float: left;
	    margin-right: 5px;
	    margin-bottom: 5px;
	    padding: 5px;
	}
	
	#hot_goods .hot_goods_body ul li:nth-child(5n){
	    margin-right: 0;
	}
	#hot_goods .hot_goods_body  img{
	    width: 220px;
	    height: 218px;
	    display: block;
	    margin: 0 auto;
	}
	
	#hot_goods .hot_goods_body p{
	    font-size: 13px;
	    padding: 10px 3px;
	    margin-bottom: 5px;
	}
    </style>
</head>
<body>
<!--头部-->
<jsp:include page="header.jsp"></jsp:include>
<!--热卖-->
<div id="hot_goods">
    <h3>热卖商品</h3>
    <div class="hot_goods_body">
        <ul>
        	<c:forEach items="${Goods}" var="good">
        		<li>
        			<a href="DetailServlet?id=${good.getPid()}">
        				<img src='images/goods/${good.getPimage() }' alt=''>
        				<p>${good.getPname()}</p>
        				<i class="yuan">￥</i><span class="price"><fmt:formatNumber
								type="number" pattern="0.00" value="${good.getPprice()*1.0} "
								maxFractionDigits="2" /></span>
        			</a>
        		</li>
        	</c:forEach>
        </ul>
    </div>
		<div class="page">
					<c:if test="${GoodsPageIndex>1&&category>1 }">
						<a href="GoodsListServlet?category=${category }&pageIndex=${GoodsPageIndex-1}">上一页</a>
					</c:if>
					<c:if test="${category>1}">
						当前是第${GoodsPageIndex }页
					</c:if>
					<c:if test="${GoodsPageIndex<pageNum&&category>1 }">
						<a href="GoodsListServlet?category=${category }&pageIndex=${GoodsPageIndex+1}">下一页</a>
					</c:if>
		</div>
</div>


<jsp:include page="footer.jsp"></jsp:include>



<script src="js/jquery.min.js"></script>
</body>
</html>

